package com.yunhe.common.model.base;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 季节电价详情对象
 * @desc 季节电价详情对象定义
 * @author chenlun
 */
public class SeasonPriceDetail implements Comparable<SeasonPriceDetail>, Serializable {
    private Long id;
    private Long priceRateId;
    private Double price;
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date startTime;
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    @Override
    public int compareTo(SeasonPriceDetail o) {
        if (this.startTime == null) {
            return -1;
        } else if (o.getStartTime() == null) {
            return 1;
        }
        return this.startTime.compareTo(o.getStartTime());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPriceRateId() {
        return priceRateId;
    }

    public void setPriceRateId(Long priceRateCode) {
        this.priceRateId = priceRateCode;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
}
